home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / envoyempire / source / muiempire.service / muiempireservicetest.c < prev    next >
C/C++ Source or Header  |  1995-07-10  |  1KB  |  42 lines

  1. #include "proto/exec.h"
  2. #include "proto/dos.h"
  3. #include "MUIEmpire_pragmas.h"
  4. #include <stdio.h>
  5. #include <utility/tagitem.h>
  6. #include <pragmas/utility_pragmas.h>
  7. #include <clib/utility_protos.h>
  8. #include <envoy/nipc.h>
  9. #include <envoy/services.h>
  10.  
  11.  
  12. char __stdiowin[] = "con:0/0/640/100";
  13.  
  14.  
  15. struct Library *MUIEmpireBase;
  16.  
  17. main()
  18. {
  19.         int ret;
  20.         struct TagItem cptags[2];
  21.         char name[20];
  22.                 
  23.         MUIEmpireBase = OpenLibrary("MUIEmpire.service",0);
  24.         if (MUIEmpireBase)
  25.         {
  26.             cptags[0].ti_Tag  = SSVC_EntityName;
  27.             cptags[0].ti_Data = (ULONG)name;
  28.             cptags[1].ti_Tag  = TAG_DONE;
  29.             cptags[1].ti_Data = NULL;
  30.  
  31.             printf("Library Opened Sucessfully.\n");
  32.             ret = StartServiceA(cptags);
  33.             
  34.             printf("test1 returned = %d\n", ret);
  35.             printf("Name %s\n",(char *)cptags[0].ti_Data);
  36.             CloseLibrary(MUIEmpireBase);
  37.             printf("Library Closed.\n");
  38.             Delay(200);
  39.         }
  40.         else printf("failed to open library!\n");
  41. }
  42.